package com.cxg.fairy.ec.main.personal.member;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;

import com.cxg.fairy.app.AccountManager;
import com.cxg.fairy.delegates.LatteDelegate;
import com.cxg.fairy.delegates.bottom.BottomItemDelegate;
import com.cxg.fairy.delegates.web.WebDelegateImpl;
import com.diabin.latte.ec.R;
import com.diabin.latte.ec.R2;

import butterknife.OnClick;
import me.yokeyword.fragmentation.anim.DefaultHorizontalAnimator;
import me.yokeyword.fragmentation.anim.FragmentAnimator;

/**
 * Created by CFairy
 */

public class MemberDelegate extends LatteDelegate {

    @Override
    public Object setLayout() {
        return R.layout.delegate_personal_member;
    }

    @Override
    public void onBindView(@Nullable Bundle savedInstanceState, @NonNull View rootView) {

    }

    @OnClick(R2.id.back_home)
    void onClickBackHome() {
        getSupportDelegate().pop();
    }

    @Override

    public void onLazyInitView(@Nullable Bundle savedInstanceState) {
        super.onLazyInitView(savedInstanceState);
        final WebDelegateImpl delegate = WebDelegateImpl.create("http://api.c-fairy.net:8080/api-restservice/member/index.html?uuid="+ AccountManager.getSignUUID());
        delegate.setTopDelegate(this.getParentDelegate());

        getSupportDelegate().loadRootFragment(R.id.web_discovery_container, delegate);
    }

    @Override
    public FragmentAnimator onCreateFragmentAnimator() {
        return new DefaultHorizontalAnimator();
    }
}
